﻿/**
 * SlotDuino
 * 
 * Copyright (c) 2011/2012 Thiago Hummel Moreira, Ricardo Mizuuti, Rafael Mufato, Bruno Sakai, Andre Turina
 * 
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or
 * sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace SlotDuino.UI.Controls
{
    /// <summary>
    /// Interaction logic for SlotCard.xaml
    /// </summary>
    public partial class SlotCard : UserControl
    {
        public static readonly DependencyProperty ColorProperty = DependencyProperty.Register("Color", typeof(Color), typeof(SlotCard));
        public static readonly DependencyProperty PilotNameProperty = DependencyProperty.Register("PilotName", typeof(string), typeof(SlotCard));
        public static readonly DependencyProperty PositionProperty = DependencyProperty.Register("Position", typeof(byte), typeof(SlotCard));
        public static readonly DependencyProperty LapCountProperty = DependencyProperty.Register("LapCount", typeof(int), typeof(SlotCard));
        public static readonly DependencyProperty LastLapProperty = DependencyProperty.Register("LastLap", typeof(TimeSpan), typeof(SlotCard));
        public static readonly DependencyProperty BestLapProperty = DependencyProperty.Register("BestLap", typeof(TimeSpan), typeof(SlotCard));
        public static readonly DependencyProperty TimeLeftProperty = DependencyProperty.Register("TimeLeft", typeof(TimeSpan), typeof(SlotCard));
        public static readonly DependencyProperty VoltageProperty = DependencyProperty.Register("Voltage", typeof(string), typeof(SlotCard));

        public Color Color
        {
            get { return (Color)GetValue(ColorProperty); }
            set { SetValue(ColorProperty, value); }
        }

        public string PilotName
        {
            get { return (string)GetValue(PilotNameProperty); }
            set { SetValue(PilotNameProperty, value); }
        }

        public byte Position
        {
            get { return (byte)GetValue(PositionProperty); }
            set { SetValue(PositionProperty, value); }
        }
        public int LapCount
        {
            get { return (int)GetValue(LapCountProperty); }
            set { SetValue(LapCountProperty, value); }
        }
        public TimeSpan LastLap
        {
            get { return (TimeSpan)GetValue(LastLapProperty); }
            set { SetValue(LastLapProperty, value); }
        }
        public TimeSpan BestLap
        {
            get { return (TimeSpan)GetValue(BestLapProperty); }
            set { SetValue(BestLapProperty, value); }
        }
        public TimeSpan TimeLeft
        {
            get { return (TimeSpan)GetValue(TimeLeftProperty); }
            set { SetValue(TimeLeftProperty, value); }
        }
        public string Voltage
        {
            get { return (string)GetValue(VoltageProperty); }
            set { SetValue(VoltageProperty, value); }
        }
        
        public SlotCard()
        {
            InitializeComponent();

            this.DataContext = this;
        }
    }
}
